/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 artifact_prop_movement.h

	$Header: /heroes4/artifact_prop_movement.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( ARTIFACT_PROP_MOVEMENT_H_INCLUDED )
#define ARTIFACT_PROP_MOVEMENT_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "artifact_prop_effect.h"

namespace t_artifact_prop
{
	// ----------------------------------------------------------------------
	// class for adventure movement bonus
	// ----------------------------------------------------------------------
	class t_movement : public t_artifact_effect
	{
	public:
		t_movement();

		virtual bool	accept( t_artifact_effect_visitor& visitor );
		bool			affects_land() const;
		bool			affects_sea() const;
		virtual bool	read( std::streambuf& buffer );
		void			set_land( bool arg );
		void			set_sea( bool arg );
		virtual bool	write( std::streambuf& buffer ) const;
	protected:
		void			init( int amount, bool land, bool sea );

		bool m_affects_land;
		bool m_affects_sea;
	};

	inline t_movement::t_movement()
	{
	}

	inline void t_movement::init( int amount, bool land, bool sea )
	{
		m_amount = amount;
		m_affects_land = land;
		m_affects_sea = sea;
	}

	inline bool t_movement::affects_land() const
	{
		return m_affects_land;
	}

	inline bool t_movement::affects_sea() const
	{
		return m_affects_sea;
	}

	inline void t_movement::set_land( bool arg )
	{
		m_affects_land = arg;
	}

	inline void t_movement::set_sea( bool arg )
	{
		m_affects_sea = arg;
	}

	typedef t_effect< t_movement, k_artifact_effect_adventure_movement > t_adventure_movement;

	inline t_artifact_effect* get_movement( int amount, bool land, bool sea )
	{
		return new t_adventure_movement( amount, land, sea );
	}
};

#endif // ARTIFACT_PROP_MOVEMENT_H_INCLUDED